<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="contextPath" value="${pageContext.servletContext.contextPath}"/>
<!doctype html>
<html lang="nl">
<head>
<link rel="stylesheet" href="styles/default.css" />
<title>Ingedriënten Zoeken</title>
</head>
<body>
<c:import url="/WEB-INF/JSP/menu.jsp" />
<h1>Sauseningedriënten</h1>
<c:url value="/ingedrienten.htm" var="url" />
<form method="get" action="${url}">
<label>Ingedriënt:<span class="fout">${fouten.ingedrient}</span><input name="ingedrient" value="${param.ingedrient}" autofocus type="text"> </label>
<input type="submit" value="Zoeken">
</form>
<c:if test="${not empty sausen }">
<h2>Deze sausen bevatten ${param.ingedrient}: </h2>
  <ul>
    <c:forEach var="saus" items="${sausen}"> 
          <li><img alt="${saus.naam}" src="images/${saus.naam}.jpg"/>
          ${saus.nummer} ${saus.naam}: 
          <c:forEach var="ingedrient" items="${saus.ingedrienten}" varStatus="status">
          ${ingedrient}${!status.last ?",":"."}</c:forEach>
          </li>
    </c:forEach>
    </ul>
</c:if>
<c:if test="${empty fouten and sausen.size()==0  }">
<div class="fout">geen sausen gevonden</div>
</c:if>
</body>
</html>